﻿/*========================== 
 * @author 郑金泉
 * @desc Math实用工具
 * ========================= */
using System;
using System.Collections.Generic;
using System.Text;

namespace Obsidian.Utils
{
    public class MathUtil
    {
        /// <summary>
        /// 计算总页数
        /// </summary>
        /// <param name="pageSize">页大小</param>
        /// <param name="count">总数</param>
        /// <returns>总页数</returns>
        public static int PagesCount(int pageSize, int count)
        {
            int pc = count / pageSize + 1;
            if (pc > 1 && count % pageSize == 0)
                pc--;
            return pc;
        }
    }
}
